<?php
	/**
	 * 获取award列表
	 */
    class AwardList extends APIBase {
		
		public $tag = "AwardList";
		public $isLogin = false;
		
		public function before() {
			$this->initCacheRedis();
			return true;
		}

		public function logic() {
			$keys = $this->cache_redis->lRange("laward:ids", 0, -1);
			$awardes = array();
			foreach ($keys as $key) {
				$award = $this->cache_redis->hMGet("haward:{$key}", array("id", "name", "coin", "desc"));
				$award["id"] = (int)$award["id"];
				$award["coin"] = (int)$award["coin"];
				$awardes[] = $award;
			}
			//header("Content-type:text/html;charset=utf-8");
			$this->returnData(array('awardes' => $awardes));
		}
		
    	public function after() {
			$this->deinitCacheRedis();
		}
    }
?>
